package com.codeZ.MementoPattern.basic;

import lombok.Data;

/**
 * 发起人
 *
 * @author codeZhang
 * @Date 2024/8/30 11:34
 */
@Data
public class Originator {

    private String state;
    public Memento createMemento(){
        return new Memento(state);
    }

    public void restoreMemento(Memento memento){
        this.state = memento.getState();
    }

}
